<?php

use backend\widgets\Bar;
use backend\grid\CheckboxColumn;
use backend\grid\ActionColumn;
use backend\grid\GridView;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title                   = '商品分类';
$this->params['breadcrumbs'][] = "商品分类";
?>
<div class="row">
    <div class="col-sm-12">
        <div class="ibox">
            <?= $this->render('/widgets/_ibox-title') ?>
            <div class="ibox-content">
                <?= Bar::widget() ?>
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'columns'      => [
                        [
                            'class' => CheckboxColumn::className(),
                        ],

                        [
                            'attribute' => 'id',
                            'width'     => '10px'
                        ],
                        'name',
                        [
                            'class'    => ActionColumn::className(),
                            'width'    => '190px',
                            'template' => '{in}{update}{delete}',
                            'buttons'  => [
                                'in' => function ($url, $model, $key) {
                                    return Html::a(
                                        '<i class="fa fa-bars" aria-hidden="true"></i>   ' . '进入',
                                        Url::to(['goods/index', 'GoodsSearch[type]' => $model['id']]),
                                        [
                                            'title'     => "进入",
                                            'data-pjax' => '0',
                                            'class'     => 'btn btn-white btn-sm J_menuItem',
                                        ]
                                    );
                                }

                            ],
                        ],
                    ],
                ]); ?>
            </div>
        </div>
    </div>
</div>
